﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DZPK.SocketImpl
{
    public class ProcessCMD
    { 
        const int SERVER_COMMAND_VOTEKICKUSER = 16416;
        const int CLIENT_COMMAND_LOGOUT = 4098;
        const int SERVER_BROADCAST_USER_STAND = 16391;
        const int SERVER_COMMAND_USER_KICK = 16408;
        const int SERVER_COMMAND_USER_FROMTOALLCHIPS = 16406;
        const int SERVER_COMMAND_SNGUSERSTANDINFO = 16426;
        const int SERVER_COMMAND_USER_NOTICEALL = 16407;
        const int SERVER_COMMAND_SNGALLLOGIN_SUCCESS = 16429;
        const int SERVER_DETECT_CONN = 28673;
        const int CONBROKEN_INTERVAL = 10;
        const int SERVER_COMMAND_USERLOGIN = 16431;
        const int CLIENT_COMMAND_USER_VOTEKICKUSER = 4109;
        const int SERVER_COMMAND_DEAL_RIVER = 16397;
        const int SERVER_COMMAND_MTTSNGUSEROVERINFO = 16441;
        const int CLIENT_COMMAND_CONNECTSUCCEED = 0x0101;
        const int CLIENT_COMMAND_USER_FROMTOALLCHIPS = 4104;
        const int SERVER_SUBPACKET_VER2 = 2;
        const int SERVER_AND_CLIENT_MAX_COMMAND = 16449;
        const int CLIENT_COMMAND_USER_STAND = 4106;
        const int SERVER_COMMAND_SNGUSERRANKINFO = 16428;
        const int SERVER_COMMAND_LOGINOUT_SUCCESS = 16413;
        const int SERVER_USERCHIPIN_ERR = 12289;
        const int CLIENT_COMMAND_CHIPIN = 4101;
        const int CLIENT_COMMAND_USER_ADDFRIEND_SUCCESS = 4108;
        const int SERVER_COMMAND_START_CHIPIN = 16398;
        const int CLIENT_COMMAND_LOTTERYBUY = 4113;
        const int SERVER_COMMAND_USERLOGOUT = 16432;
        const int CLIENT_COMMAND_CONTINUE = 4116;
        const int CLIENT_COMMAND_UPDATE_USER_INFO = 4117;
        const int SERVER_COMMAND_USER_CHAT = 16403;
        const int SERVER_COMMAND_LOGIN_ERR = 16386;
        const int SERVER_COMMAND_VENUECOSTS = 16422;
        const int SERVER_COMMAND_FINAL_GAME = 16401;
        const int SERVER_COMMAND_USER_CHANGE_SERVER = 20481;
        const int DETECT_CONN_TIME = 30;
        const int SERVER_COMMAND_DEAL_PREFLOP = 16394;
        const int SERVER_COMMAND_STANDTIMING = 0x4040;
        const int CLIENT_COMMAND_USER_ADDFRIEND = 4107;
        const int SERVER_SUBPACKET_VER = 1;
        const int SERVER_COMMAND_PACKETVERERR = 12290;
        const int SERVER_COMMAND_MTTSNGRANKDATA = 16439;
        const int CLIENT_ECHO_CONN = 28674;
        const int CLIENT_CMD_CONNECT_GAMESERVER_S = 8193;
        const int SERVER_COMMAND_USERUPDATAEXP = 16437;
        const int SERVER_COMMAND_SHOWDEALPREFLOPCARD = 16438;
        const int SERVER_COMMAND_SYSMSG = 16410;
        const int CLIENT_COMMAND_USER_KICKUSER_REQUEST = 4110;
        const int SERVER_COMMAND_TABLECHATHISTORY = 16409;
        const int SERVER_PACKET_VER = 2;
        const int SERVER_COMMAND_STOPSERVER = 16420;
        const int SERVER_COMMAND_SNGTALBESTATE = 16427;
        const int SERVER_COMMAND_BIND_SUCCESS = 16404;
        const int CLIENT_COMMAND_CHANGE_SERVER_USER_LOGIN = 4118;
        const int CLIENT_COMMAND_CONNECTFAILED = 258;
        const int CLIENT_COMMAND_SNGTABLEINFO = 0x1010;
        const int SERVER_COMMAND_SYSTOOTHER = 16412;
        const int SERVER_COMMAND_MTTFINAL = 16445;
        const int CLIENT_COMMAND_USER_SMALLFEES = 4111;
        const int CLIENT_COMMAND_SHOWDEALPREFLOPCARD = 4114;
        const int SERVER_COMMAND_USER_KICKUSER_RESPONSE = 16417;
        const int SERVER_COMMAND_DEAL_TURN = 16396;
        const int CLIENT_COMMAND_SIT_REQUEST = 4099;
        const int SERVER_COMMAND_SNGTIMESMALLBLIN = 16433;
        const int SERVER_COMMAND_GLODRUSHCHANGEROOM = 16446;
        const int CLIENT_CMD_CONNECT_GAMESERVER = 2049;
        const int SERVER_CMD_CONNECT_GAMESERVER_FAILED_S = 8195;
        const int SERVER_COMMAND_USER_FROMTOCHIPS = 16405;
        const int SERVER_COMMAND_USER_ADDFRIEND_SUCCESS = 16415;
        const int SERVER_BROADCAST_USER_SIT = 16390;
        const int SERVER_COMMAND_LOTTERYBUY = 16434;
        const int SERVER_COMMAND_SYSKICKUSER = 16436;
        const int CLIENT_COMMAND_USER_NOTICEALL = 4105;
        const int SERVER_COMMAND_RANK_ONE_NOTICE = 16451;
        const int SERVER_COMMAND_LOGIN_SUCCESS = 16387;
        const int SERVER_COMMAND_SIT_FAILED = 16389;
        const int SERVER_CMD_CONNECT_GAMESERVER_FAILED = 2306;
        const int SERVER_COMMAND_SHOW_PREFLOP = 16402;
        const int SERVER_COMMAND_USER_ADDFRIEND = 16414;
        const int SERVER_COMMAND_CHANGESERVER = 16444;
        const int CLIENT_COMMAND_TABLEINFO_REQUEST = 4100;
        const int SERVER_COMMAND_DEAL_FLOP = 16395;
        const int CLIENT_COMMAND_USER_FROMTOCHIPS = 4103;
        const int SERVER_COMMAND_USER_ACTION = 16399;
        const int SERVER_COMMAND_SNGBIND_SUCCESS = 16424;
        const int SERVER_COMMAND_SNGALLBIND_SUCCESS = 16430;
        const int SERVER_COMMAND_LOTTERYMONEY = 16435;
        const int SERVER_COMMAND_SNGLOGIN_SUCCESS = 16423;
        const int SERVER_COMMAND_FINAL_ROUND = 16400;
        const int SERVER_COMMAND_SIT_SUCCESS = 16388;
        const int SERVER_COMMAND_USER_NOT_FOUND = 16385;
        const int SERVER_COMMAND_VOTEEND = 16418;
        const int SERVER_BROADCAST_GAME_START = 16393;
        const int SERVER_COMMAND_KICKUSER_RESPONSE = 16419;
        const int SERVER_CMD_CONNECT_GAMESERVER_SUCCESS = 2305;
        const int SERVER_COMMAND_USER_SMALLFEES = 16421;
        const int CLIENT_COMMAND_LOGIN = 4097;
        const int SERVER_CMD_CONNECT_GAMESERVER_SUCCESS_S = 8194;
        const int CLIENT_COMMAND_USER_CHAT = 4102;
        const int SERVER_COMMAND_MTTSNGTIMESTART = 16443;
        const int SERVER_COMMAND_SYSTOUSERCHIPS = 16411;
        const int SERVER_COMMAND_TABLEINFO_RESPONSE = 16392;
        const int SERVER_COMMAND_MTTSNGUSERRANKINFO = 16440;
        const int CLIENT_COMMAND_CONNECTCLOSE = 259;
        const int SERVER_BROADCAST_SNGGAME_START = 16425;
        const int SERVER_COMMAND_MTTSNGCHANGETABLE = 16442;
        const int CLIENT_COMMAND_MTTSNGRANKDATA = 4115;

        //private var _myClientSocket:IClientSocket = null;
        private TcpSocket _mySokcet = null;
        //private var _gameProceess:IProcessCMD = null; // should be logic layer processor

        //public ProcessCMD(_arg1:IProcessCMD)
        public ProcessCMD(TcpSocket socket)
        {
            //_gameProceess = null;
            //_myClientSocket = null;
            //_mySokcet = null;
            //super();
            //_gameProceess = _arg1;
            _mySokcet = socket;
        }

        //public function SetClientSocket(_arg1:IClientSocket)
        //{
        //    _mySokcet = _arg1.getISocket();
        //    _myClientSocket = _arg1;
        //}

        private void S_LotteryMoney()
        {
            //var _local1:int;
            //var _local2:Array;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //var _local7:uint;
            //var _local8:Number;
            //var _local9:uint;
            //var _local10:uint;
            //var _local11:uint;
            //var _local12:uint;
            //var _local13:uint;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.getsubver();
            //_local2 = new Array();
            //_local3 = _mySokcet.readByte();
            //_local4 = 0;
            //while (_local4 < _local3)
            //{
            //    _local5 = _mySokcet.readInt();
            //    _local6 = _mySokcet.readInt();
            //    _local7 = _mySokcet.readByte();
            //    _local8 = 0;
            //    if (_local1 == SERVER_SUBPACKET_VER2)
            //    {
            //        _local8 = _mySokcet.readInt64();
            //    }
            //    else
            //    {
            //        _local8 = _mySokcet.readInt();
            //    };
            //    _local9 = _mySokcet.readShort();
            //    _local10 = _mySokcet.readShort();
            //    _local11 = _mySokcet.readShort();
            //    _local12 = _mySokcet.readShort();
            //    _local13 = _mySokcet.readShort();
            //    _local2.push([_local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13]);
            //    _local4++;
            //};
            //_gameProceess.ProcessLotteryMoneySucceed(_local2);
            throw new NotImplementedException();
        }

        private void S_GameStart()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:Array;
            //var _local6:int;
            //var _local7:Array;
            //var _local8:int;
            //var _local9:int;
            //var _local10:int;
            //var _local11:int;
            //var _local12:Number;
            //var _local13:Number;
            //var _local14:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readByte();
            //_local4 = _mySokcet.readByte();
            //_local5 = [];
            //_local6 = 0;
            //while (_local6 < _local4)
            //{
            //    _local11 = _mySokcet.readByte();
            //    _local12 = _mySokcet.readInt64();
            //    _local13 = _mySokcet.readInt64();
            //    _local14 = _mySokcet.readInt64();
            //    _gameProceess.ProcessUpdataChips(_local11, _local12, _local13, _local2, _local14);
            //    _local5.push(_local11);
            //    _local6++;
            //};
            //_local7 = judgeBlind(_local3, _local5);
            //_local8 = _local7[0];
            //_local9 = _local7[1];
            //_local10 = 0;
            //while (_local10 < _local4)
            //{
            //    _gameProceess.setBlindState(_local5[_local10], _local8, _local9);
            //    _local10++;
            //};
            //_gameProceess.ProcessGameStart();
            //if ((((_local4 >= 2)) && ((_local3 >= 0))))
            //{
            //    _gameProceess.ProcessStartDealCard(_local3);
            //};
            throw new NotImplementedException();
        }

        private void S_SngallBindSuccess()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:String;
            //var _local5:int;
            //var _local6:int;
            //var _local7:uint;
            //var _local8:uint;
            //var _local9:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readString();
            //_local5 = _mySokcet.readInt();
            //_local6 = _mySokcet.readShort();
            //_local7 = 0;
            //_local8 = 0;
            //if (_local6 != 0)
            //{
            //    _local7 = _mySokcet.readShort();
            //    _local8 = _mySokcet.readShort();
            //};
            //_local9 = _mySokcet.readInt();
            //_gameProceess.ProcessSngAllBindSuccess(_local4, _local1, _local2, _local3, _local5, _local6, _local7, _local8, _local9);
            throw new NotImplementedException();
        }

        private void S_SngBindSuccess()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:Number;
            //var _local5:Number;
            //var _local6:int;
            //var _local7:int;
            //var _local8:Number;
            //var _local9:Number;
            //var _local10:Number;
            //var _local11:int;
            //var _local12:int;
            //var _local13:int;
            //var _local14:int;
            //var _local15:String;
            //var _local16:Number;
            //var _local17:int;
            //var _local18:uint;
            //var _local19:uint;
            //var _local20:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt64();
            //_local5 = _mySokcet.readInt64();
            //_local6 = _mySokcet.readInt();
            //_local7 = _mySokcet.readInt();
            //_local8 = _mySokcet.readInt64();
            //_local9 = _mySokcet.readInt64();
            //_local10 = _mySokcet.readInt64();
            //_local11 = _mySokcet.readInt();
            //_local12 = _mySokcet.readInt();
            //_local13 = _mySokcet.readInt();
            //_local14 = _mySokcet.readInt();
            //_local15 = _mySokcet.readString();
            //_local16 = _mySokcet.readInt64();
            //_local17 = _mySokcet.readShort();
            //_local18 = 0;
            //_local19 = 0;
            //if (_local17 != 0)
            //{
            //    _local18 = _mySokcet.readShort();
            //    _local19 = _mySokcet.readShort();
            //};
            //_local20 = _mySokcet.readInt();
            //_gameProceess.ProcessSngBindSuccess(_local15, _local1, _local2, _local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14, _local16, _local17, _local18, _local19, _local20);
            throw new NotImplementedException();
        }

        private void S_UserUpdataExp()
        {
            //var _local1:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readString();
            //_gameProceess.ProcessUserUpdataExp(_local1);
            throw new NotImplementedException();
        }

        private void S_UserFromToChips()
        {
            //var _local1:int;
            //var _local2:Number;
            //var _local3:int;
            //var _local4:Number;
            //var _local5:int;
            //var _local6:int;
            //var _local7:Number;
            //var _local8:int;
            //var _local9:String;
            //var _local10:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt64();
            //_local3 = _mySokcet.readByte();
            //_local4 = _mySokcet.readInt64();
            //_local5 = _mySokcet.readByte();
            //_local6 = _mySokcet.readByte();
            //_local7 = _mySokcet.readInt64();
            //_local8 = _mySokcet.readInt();
            //_local9 = _mySokcet.readString();
            //_local10 = _mySokcet.readInt();
            //_gameProceess.ProceesUserFromToChips(_local1, _local2, _local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10);
            throw new NotImplementedException();
        }

        private void S_VoteEnd()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //var _local7:int;
            //var _local8:int;
            //var _local9:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readByte();
            //_local5 = _mySokcet.readByte();
            //_local6 = _mySokcet.readByte();
            //_local7 = _mySokcet.readByte();
            //_local8 = _mySokcet.readInt();
            //_local9 = _mySokcet.readInt();
            //_gameProceess.ProcessVoteEnd(_local1, _local2, _local3, _local4, _local5, _local6, _local7, _local8, _local9);
            throw new NotImplementedException();
        }

        private void S_MttSngUserRankInfo()
        {
            //var _local1:int;
            //var _local2:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_gameProceess.ProcessMttSngUserRankInfo(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_Standtiming()
        {
            //var _local1:Number;
            //var _local2:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt64();
            //_local2 = _mySokcet.readByte();
            //_gameProceess.ProcessStandtiming(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_SngGameStart()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //var _local7:Number;
            //var _local8:Number;
            //var _local9:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readByte();
            //_local4 = _mySokcet.readByte();
            //_local5 = 0;
            //while (_local5 < _local4)
            //{
            //    _local6 = _mySokcet.readByte();
            //    _local7 = _mySokcet.readInt64();
            //    _local8 = _mySokcet.readInt64();
            //    _local9 = _mySokcet.readInt64();
            //    _gameProceess.ProcessUpdataChips(_local6, _local7, _local8, _local2, _local9);
            //    _local5++;
            //};
            //_gameProceess.ProcessGameStart();
            //if ((((_local4 >= 2)) && ((_local3 >= 0))))
            //{
            //    _gameProceess.ProcessStartDealCard(_local3, _local1);
            //};
            throw new NotImplementedException();
        }

        private void S_LotteryBuy()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt64();
            //_gameProceess.ProcessLotteryBuySucceed(_local2, _local1, _local3, _local4);
            throw new NotImplementedException();
        }

        private void S_SysKickUser()
        {
            //_mySokcet.readbegin();
            //_gameProceess.ProceesSysKickUserSuccess(0);
            throw new NotImplementedException();
        }

        private void P_ConnectGameServerFailed()
        {
            //_gameProceess.ProcessConnectGameServerFailed(_myClientSocket.getConnectFailType());
            throw new NotImplementedException();
        }

        private void S_GlodRushFinel()
        {
            //_gameProceess.ProcessGlodRushFinal();
            throw new NotImplementedException();
        }

        private void S_ChipPin()
        {
            //var _local1:int;
            //var _local2:Number;
            //var _local3:Number;
            //var _local4:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt64();
            //_local3 = _mySokcet.readInt64();
            //_local4 = _mySokcet.readInt64();
            //_gameProceess.ProcessStartChipin(_local1, _local2, _local3, _local4);
            throw new NotImplementedException();
        }

        private void S_SngTalbeState()
        {
            //var _local1:int;
            //var _local2:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_gameProceess.ProcessSngTalbeState(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_ChangeServer()
        {
            //_gameProceess.ProcessChangeServer();
            throw new NotImplementedException();
        }

        private void S_SngUserStandInfo()
        {
            //var _local1:int;
            //var _local2:Number;
            //var _local3:int;
            //var _local4:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt64();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt();
            //_gameProceess.ProcessSngUserStandInfo(_local1, _local2, _local3, _local4);
            throw new NotImplementedException();
        }

        private void S_MttSngRankData()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:Array;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //var _local7:String;
            //var _local8:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_local3 = new Array();
            //_local4 = 0;
            //while (_local4 < _local2)
            //{
            //    _local5 = _mySokcet.readInt();
            //    _local6 = _mySokcet.readInt64();
            //    _local7 = _mySokcet.readString();
            //    _local8 = _mySokcet.readString();
            //    _local3.push([_local5, _local6, _local7, String((_local4 + 1)), _local8]);
            //    _local4++;
            //};
            //_gameProceess.ProcessMttSngRankData(_local3, _local1);
            throw new NotImplementedException();
        }

        private void S_UserFromToAllChips()
        {
            //var _local1:int;
            //var _local2:Number;
            //var _local3:int;
            //var _local4:String;
            //var _local5:int;
            //var _local6:int;
            //var _local7:int;
            //var _local8:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt64();
            //_local3 = _mySokcet.readByte();
            //_local4 = _mySokcet.readString();
            //_local5 = _mySokcet.readByte();
            //_local6 = 0;
            //while (_local6 < _local5)
            //{
            //    _local7 = _mySokcet.readByte();
            //    _local8 = _mySokcet.readInt64();
            //    _gameProceess.ProceesUserFromToChips(_local1, _local2, _local7, _local8, _local3, 0, 0, 0, _local4, 0);
            //    _local6++;
            //};
            throw new NotImplementedException();
        }

        private void S_ShowPreflop()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:uint;
            //var _local5:uint;
            //var _local6:Boolean;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = 0;
            //while (_local2 < _local1)
            //{
            //    _local3 = _mySokcet.readByte();
            //    _local4 = _mySokcet.readShort();
            //    _local5 = _mySokcet.readShort();
            //    _local6 = Boolean(_mySokcet.readByte());
            //    _gameProceess.ProcessAddShowPreflop(_local3, _local4, _local5, _local6);
            //    _local2++;
            //};
            //if (_local1 > 0)
            //{
            //    _gameProceess.ProcessShowPreflop();
            //};
            throw new NotImplementedException();
        }

        private void S_DealTurn()
        {
            //var _local1:uint;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readShort();
            //_gameProceess.ProcessDealTurn(_local1);
            throw new NotImplementedException();
        }

        private void S_ShowDealPreflopCard()
        {
            //var _local1:int;
            //var _local2:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_gameProceess.ProcessShowDealPreflopCard(_local2, _local1);
            throw new NotImplementedException();
        }

        private void S_LoginFailed()
        {
            //var _local1:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_gameProceess.ProcessLoginFailed(_local1);
            throw new NotImplementedException();
        }

        private void S_UserLogOut()
        {
            //var _local1:int;
            //var _local2:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readString();
            //_gameProceess.ProcessUserLogOut(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_UserSit()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:Number;
            //var _local4:String;
            //var _local5:String;
            //var _local6:String;
            //var _local7:String;
            //var _local8:String;
            //var _local9:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt64();
            //_local4 = _mySokcet.readString();
            //_local5 = _mySokcet.readString();
            //_local6 = _mySokcet.readString();
            //_local7 = _mySokcet.readString();
            //_local8 = _mySokcet.readString();
            //_local9 = _mySokcet.readInt64();
            //_gameProceess.ProcessUserSit(_local1, _local2, _local9, 0, _local4, _local5, _local6, _local7, _local8, 0, _local3, 0);
            throw new NotImplementedException();
        }

        private void S_LoginOutSuccess()
        {
            //_mySokcet.readbegin();
            //_gameProceess.ProceesLoginOutSuccess();
            throw new NotImplementedException();
        }

        private void C_ConnectFailed()
        {
            //_gameProceess.ProcessConnectFailed(_myClientSocket.getConnectFailType());
            throw new NotImplementedException();
        }

        private void S_DealFolp()
        {
            //var _local1:uint;
            //var _local2:uint;
            //var _local3:uint;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readShort();
            //_local2 = _mySokcet.readShort();
            //_local3 = _mySokcet.readShort();
            //_gameProceess.ProcessDealFlop(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_SysMsg()
        {
            //var _local1:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readString();
            //_gameProceess.ProcessSysMsg(_local1);
            throw new NotImplementedException();
        }

        private void S_SitFailed()
        {
            //var _local1:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_gameProceess.ProcessSitFailed(_local1);
            throw new NotImplementedException();
        }

        private void S_SngTimeSmallblin()
        {
            //var _local1:int;
            //var _local2:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_gameProceess.ProcessSngTimeSmallblin(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_DealPreflop()
        {
            //var _local1:int;
            //var _local2:uint;
            //var _local3:uint;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //trace(("DealPreflop:" + _local1));
            //_local2 = _mySokcet.readShort();
            //_local3 = _mySokcet.readShort();
            //_gameProceess.ProcessDealPrefLop(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_UserNoticeAll()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readString();
            //_gameProceess.ProcessUserNoticeAll(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_UserAddFriend()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt();
            //_local5 = _mySokcet.readString();
            //_gameProceess.ProcessUserAddFriend(_local1, _local2, _local3, _local4, _local5);
            throw new NotImplementedException();
        }

        private void S_UserKickUserResponse()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readInt();
            //_gameProceess.ProcessVoteResponse(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_MttSngUserOverInfo()
        {
            //var _local1:int;
            //var _local2:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_gameProceess.ProcessMttSngUserOverInfo(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_SngallLoginSuccess()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:String;
            //var _local5:int;
            //var _local6:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readString();
            //_local5 = _mySokcet.readInt();
            //_local6 = _mySokcet.readInt();
            //_gameProceess.ProcessSngAllLoginSuccess(_local4, _local1, _local2, _local3, _local5, _local6);
            throw new NotImplementedException();
        }

        private void S_UserKick()
        {
            //_gameProceess.ProcessUserKick();
            throw new NotImplementedException();
        }

        private void S_UserStand()
        {
            //var _local1:int;
            //var _local2:String;
            //var _local3:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readString();
            //_local3 = _mySokcet.readInt64();
            //_gameProceess.ProcessUserStand(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_TableChatHistory()
        {
            //var _local1:int;
            //var _local2:*;
            //var _local3:int;
            //var _local4:String;
            //var _local5:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = 0;
            //while (_local2 < _local1)
            //{
            //    _local3 = _mySokcet.readInt();
            //    _local4 = _mySokcet.readString();
            //    _local5 = _mySokcet.readString();
            //    _gameProceess.ProcessUserChat(_local3, _local4, _local5);
            //    _local2++;
            //};
            throw new NotImplementedException();
        }

        private void S_Venuecosts()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:Number;
            //var _local6:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = 0;
            //while (_local2 < _local1)
            //{
            //    _local3 = _mySokcet.readByte();
            //    _local4 = _mySokcet.readInt();
            //    _local5 = _mySokcet.readInt64();
            //    _local6 = _mySokcet.readInt64();
            //    _gameProceess.ProcessVenuecosts(_local3, _local4, _local5, _local6);
            //    _local2++;
            //};
            throw new NotImplementedException();
        }

        private void S_FinalRound()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:Array;
            //var _local4:int;
            //var _local5:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readByte();
            //_local3 = new Array();
            //_local4 = 0;
            //while (_local4 <= _local2)
            //{
            //    _local5 = _mySokcet.readInt64();
            //    _local3.push(_local5);
            //    _local4++;
            //};
            //_gameProceess.ProcessFinalRound(_local3, _local1);
            //_local3 = null;
            throw new NotImplementedException();
        }

        private void S_SmallFees()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt64();
            //_gameProceess.ProcessSmallFees(_local1, _local2, _local3, _local4);
            throw new NotImplementedException();
        }

        private void S_GlodRushChangeRoom()
        {
            //var _local1:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_gameProceess.ProcessGlodRushChangeRoom(_local1);
            throw new NotImplementedException();
        }

        private void C_ConnectClose()
        {
            //_gameProceess.ProcessConnectClose();
            throw new NotImplementedException();
        }

        private void S_KickUserResponse()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readByte();
            //_local5 = _mySokcet.readInt();
            //_gameProceess.ProcessKickUserResponse(_local1, _local2, _local3, _local4, _local5);
            throw new NotImplementedException();
        }

        private void S_VoteKickUser()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readByte();
            //_local5 = _mySokcet.readInt();
            //_local6 = _mySokcet.readInt();
            //_gameProceess.ProcessVoteKiceUserResponse(_local1, _local2, _local3, _local4, _local5, _local6);
            throw new NotImplementedException();
        }

        private void C_ConnectSucced()
        {
            ////trace("链接成功");
            //_gameProceess.ProcessConnectSucceed();
            throw new NotImplementedException();
        }

        private void S_SitSuccess()
        {
            //var _local1:int;
            //var _local2:String;
            //var _local3:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readString();
            //_local3 = _mySokcet.readInt64();
            //_gameProceess.ProcessSitSuccess(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_UserLogin()
        {
            //var list:Array;
            //var uid:* = undefined;
            //var count:int;
            //var i:int;
            //var id:int;
            //var name:String;
            //var count1:int;
            //var j:int;
            //var id1:int;
            //var name1:String;
            //var nChips1:Number;
            //var iconurl1:String;
            //try
            //{
            //    list = new Array();
            //    _mySokcet.readbegin();
            //    count = _mySokcet.readInt();
            //    i = 0;
            //    while (i < count)
            //    {
            //        id = _mySokcet.readInt();
            //        name = _mySokcet.readString();
            //        list[id] = name;
            //        i = (i + 1);
            //    };
            //}
            //catch(e:Error)
            //{
            //    list = new Array();
            //    _mySokcet.readbegin();
            //    count1 = _mySokcet.readInt();
            //    j = 0;
            //    while (j < count)
            //    {
            //        id1 = _mySokcet.readInt();
            //        name1 = _mySokcet.readString();
            //        nChips1 = _mySokcet.readInt64();
            //        iconurl1 = _mySokcet.readString();
            //        list[id1] = name1;
            //        j = (j + 1);
            //    };
            //};
            //for (uid in list)
            //{
            //    _gameProceess.ProcessUserLogin(int(uid), list[uid]);
            //};
            //throw new NotImplementedException();
        }

        private void P_ConnectGameServerSuccess()
        {
            //_gameProceess.ProcessConnectGameServerSuccess();
            throw new NotImplementedException();
        }

        private void S_SysToOther()
        {
            //var _local1:int;
            //var _local2:String;
            //var _local3:Number;
            //var _local4:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readString();
            //_local3 = _mySokcet.readInt64();
            //_local4 = _mySokcet.readInt();
            //_gameProceess.ProcessSysToOther(_local1, _local2, _local3, _local4);
            throw new NotImplementedException();
        }

        private void S_UserChat()
        {
            //var _local1:int;
            //var _local2:String;
            //var _local3:String;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readString();
            //_local3 = _mySokcet.readString();
            //_gameProceess.ProcessUserChat(_local1, _local2, _local3);
            throw new NotImplementedException();
        }

        private void S_PacetVerErr()
        {
            //_mySokcet.readbegin();
            //_gameProceess.ProceesPacketVerErr();
            throw new NotImplementedException();
        }

        private void S_SngLoginSuccess()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:Number;
            //var _local5:Number;
            //var _local6:int;
            //var _local7:int;
            //var _local8:Number;
            //var _local9:Number;
            //var _local10:Number;
            //var _local11:int;
            //var _local12:int;
            //var _local13:int;
            //var _local14:int;
            //var _local15:String;
            //var _local16:Number;
            //var _local17:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readInt();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt64();
            //_local5 = _mySokcet.readInt64();
            //_local6 = _mySokcet.readInt();
            //_local7 = _mySokcet.readInt();
            //_local8 = _mySokcet.readInt64();
            //_local9 = _mySokcet.readInt64();
            //_local10 = _mySokcet.readInt64();
            //_local11 = _mySokcet.readInt();
            //_local12 = _mySokcet.readInt();
            //_local13 = _mySokcet.readInt();
            //_local14 = _mySokcet.readInt();
            //_local15 = _mySokcet.readString();
            //_local16 = _mySokcet.readInt64();
            //_local17 = _mySokcet.readInt();
            //_gameProceess.ProcessSngLoginSuccess(_local15, _local1, _local2, _local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14, _local16, _local17);
            throw new NotImplementedException();
        }

        private void S_UserAddFriendSuccess()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readInt();
            //_local4 = _mySokcet.readInt();
            //_gameProceess.ProcessUserAddFriendSuccess(_local1, _local2, _local3, _local4);
            throw new NotImplementedException();
        }

        private void S_GoldrushChangeSever()
        {
            //_gameProceess.ProcessGoldRushChangeSever();
            throw new NotImplementedException();
        }

        private void S_SysToUserChips()
        {
            //var _local1:int;
            //var _local2:String;
            //var _local3:Number;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readByte();
            //_local2 = _mySokcet.readString();
            //_local3 = _mySokcet.readInt64();
            //_local4 = _mySokcet.readInt();
            //_local5 = _mySokcet.readInt();
            //_local6 = _mySokcet.readInt();
            //_gameProceess.ProcessSysToUserChips(_local1, _local2, _local3, _local4, _local5, _local6);
            throw new NotImplementedException();
        }

        private void S_SngUserRankInfo()
        {
            //var _local1:Array;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //var _local7:int;
            //var _local8:Number;
            //var _local9:Number;
            //var _local10:int;
            //var _local11:int;
            //var _local12:int;
            //var _local13:String;
            //var _local14:String;
            //var _local15:String;
            //_local1 = new Array();
            //_mySokcet.readbegin();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readByte();
            //_local4 = 0;
            //while (_local4 < _local3)
            //{
            //    _local5 = _mySokcet.readInt();
            //    _local6 = _mySokcet.readInt();
            //    _local7 = _mySokcet.readInt();
            //    _local8 = _mySokcet.readInt64();
            //    _local9 = _mySokcet.readInt();
            //    _local10 = _mySokcet.readInt();
            //    _local11 = _mySokcet.readInt();
            //    _local12 = _mySokcet.readInt();
            //    _local13 = _mySokcet.readString();
            //    _local14 = _mySokcet.readString();
            //    _local15 = _mySokcet.readString();
            //    _local1.push([_local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14, _local15]);
            //    _local4++;
            //};
            //_gameProceess.ProcessUserRankInfo(_local1, _local2);
            throw new NotImplementedException();
        }

        private void S_LoginSuccess()
        {
            int _local1;
            int _local2;
            Int64 _local3;
            Int64 _local4;
            string _local5;
            Int64 _local6;
            int _local7;
            _mySokcet.readbegin();
            _local1 = _mySokcet.getsubver();
            _local2 = _mySokcet.readInt();
            if (_local1 == SERVER_SUBPACKET_VER2)
            {
                _local3 = _mySokcet.readInt64();
                _local4 = _mySokcet.readInt64();
            }
            else
            {
                _local3 = _mySokcet.readInt();
                _local4 = _mySokcet.readInt();
            };
            _local5 = _mySokcet.readString();
            _local6 = _mySokcet.readInt64();
            _local7 = _mySokcet.readInt();
            //_gameProceess.ProcessLoginSuccess(_local5, _local2, _local3, _local4, _local6, _local7);
            //throw new NotImplementedException();
        }

        public void ProcessServerCMD(int cmd)
        {
            switch (cmd)
            {
                case CLIENT_COMMAND_CONNECTSUCCEED:
                    //trace("CLIENT_COMMAND_CONNECTSUCCEED");
                    C_ConnectSucced();
                    return;
                case CLIENT_COMMAND_CONNECTFAILED:
                    //trace("CLIENT_COMMAND_CONNECTFAILED");
                    C_ConnectFailed();
                    return;
                case CLIENT_COMMAND_CONNECTCLOSE:
                    //trace("CLIENT_COMMAND_CONNECTCLOSE");
                    C_ConnectClose();
                    return;
                case SERVER_COMMAND_LOGIN_SUCCESS:
                    //trace("SERVER_COMMAND_LOGIN_SUCCESS");
                    S_LoginSuccess();
                    return;
                case SERVER_COMMAND_BIND_SUCCESS:
                    //trace("SERVER_COMMAND_BIND_SUCCESS");
                    S_BindSuccess();
                    return;
                case SERVER_COMMAND_SIT_SUCCESS:
                    //trace("SERVER_COMMAND_SIT_SUCCESS");
                    S_SitSuccess();
                    return;
                case SERVER_COMMAND_LOGIN_ERR:
                    //trace("SERVER_COMMAND_LOGIN_ERR");
                    S_LoginFailed();
                    return;
                case SERVER_COMMAND_SIT_FAILED:
                    //trace("SERVER_COMMAND_SIT_FAILED");
                    S_SitFailed();
                    return;
                case SERVER_BROADCAST_USER_SIT:
                    //trace("SERVER_BROADCAST_USER_SIT");
                    S_UserSit();
                    return;
                case SERVER_BROADCAST_USER_STAND:
                    //trace("SERVER_BROADCAST_USER_STAND");
                    S_UserStand();
                    return;
                case SERVER_COMMAND_TABLEINFO_RESPONSE:
                    //trace("SERVER_COMMAND_TABLEINFO_RESPONSE");
                    S_Tableinfo();
                    return;
                case SERVER_BROADCAST_GAME_START:
                    //trace("SERVER_BROADCAST_GAME_START");
                    S_GameStart();
                    return;
                case SERVER_COMMAND_DEAL_PREFLOP:
                    //trace("SERVER_COMMAND_DEAL_PREFLOP");
                    S_DealPreflop();
                    return;
                case SERVER_COMMAND_DEAL_FLOP:
                    //trace("SERVER_COMMAND_DEAL_FLOP");
                    S_DealFolp();
                    return;
                case SERVER_COMMAND_DEAL_TURN:
                    //trace("SERVER_COMMAND_DEAL_TURN");
                    S_DealTurn();
                    return;
                case SERVER_COMMAND_DEAL_RIVER:
                    //trace("SERVER_COMMAND_DEAL_RIVER");
                    S_DealRiver();
                    return;
                case SERVER_COMMAND_START_CHIPIN:
                    //trace("SERVER_COMMAND_START_CHIPIN");
                    S_ChipPin();
                    return;
                case SERVER_COMMAND_USER_ACTION:
                    //trace("SERVER_COMMAND_USER_ACTION");
                    S_UserAction();
                    return;
                case SERVER_COMMAND_FINAL_ROUND:
                    //trace("SERVER_COMMAND_FINAL_ROUND");
                    S_FinalRound();
                    return;
                case SERVER_COMMAND_FINAL_GAME:
                    //trace("SERVER_COMMAND_FINAL_GAME");
                    S_FinalGame();
                    return;
                case SERVER_COMMAND_SHOW_PREFLOP:
                    //trace("SERVER_COMMAND_SHOW_PREFLOP");
                    S_ShowPreflop();
                    return;
                case SERVER_COMMAND_USER_CHAT:
                    //trace("SERVER_COMMAND_USER_CHAT");
                    S_UserChat();
                    return;
                case SERVER_USERCHIPIN_ERR:
                    //trace("SERVER_USERCHIPIN_ERR");
                    S_UserChipInErr();
                    return;
                case SERVER_COMMAND_PACKETVERERR:
                    //trace("SERVER_COMMAND_PACKETVERERR");
                    S_PacetVerErr();
                    return;
                case SERVER_COMMAND_USER_FROMTOCHIPS:
                    //trace("SERVER_COMMAND_USER_FROMTOCHIPS");
                    S_UserFromToChips();
                    return;
                case SERVER_COMMAND_USER_FROMTOALLCHIPS:
                    //trace("SERVER_COMMAND_USER_FROMTOALLCHIPS");
                    S_UserFromToAllChips();
                    return;
                case SERVER_COMMAND_USER_NOTICEALL:
                    //trace("SERVER_COMMAND_USER_NOTICEALL");
                    S_UserNoticeAll();
                    return;
                case SERVER_COMMAND_USER_KICK:
                    //trace("SERVER_COMMAND_USER_KICK");
                    S_UserKick();
                    return;
                case SERVER_COMMAND_TABLECHATHISTORY:
                    //trace("SERVER_COMMAND_TABLECHATHISTORY");
                    S_TableChatHistory();
                    return;
                case SERVER_COMMAND_SYSMSG:
                    //trace("SERVER_COMMAND_SYSMSG");
                    S_SysMsg();
                    return;
                case SERVER_COMMAND_SYSTOUSERCHIPS:
                    //trace("SERVER_COMMAND_SYSTOUSERCHIPS");
                    S_SysToUserChips();
                    return;
                case SERVER_COMMAND_SYSTOOTHER:
                    //trace("SERVER_COMMAND_SYSTOOTHER");
                    S_SysToOther();
                    return;
                case SERVER_COMMAND_LOGINOUT_SUCCESS:
                    //trace("SERVER_COMMAND_LOGINOUT_SUCCESS");
                    S_LoginOutSuccess();
                    return;
                case SERVER_COMMAND_USER_ADDFRIEND:
                    //trace("SERVER_COMMAND_USER_ADDFRIEND");
                    S_UserAddFriend();
                    return;
                case SERVER_COMMAND_USER_ADDFRIEND_SUCCESS:
                    //trace("SERVER_COMMAND_USER_ADDFRIEND_SUCCESS");
                    S_UserAddFriendSuccess();
                    return;
                case SERVER_COMMAND_VOTEKICKUSER:
                    //trace("SERVER_COMMAND_VOTEKICKUSER");
                    S_VoteKickUser();
                    return;
                case SERVER_COMMAND_USER_KICKUSER_RESPONSE:
                    //trace("SERVER_COMMAND_USER_KICKUSER_REQUEST");
                    S_UserKickUserResponse();
                    return;
                case SERVER_COMMAND_VOTEEND:
                    //trace("SERVER_COMMAND_VOTEEND");
                    S_VoteEnd();
                    return;
                case SERVER_COMMAND_KICKUSER_RESPONSE:
                    //trace("SERVER_COMMAND_KICKUSER_RESPONSE");
                    S_KickUserResponse();
                    return;
                case SERVER_COMMAND_STOPSERVER:
                    //trace("SERVER_COMMAND_STOPSERVER");
                    S_StopServer();
                    return;
                case SERVER_COMMAND_USER_SMALLFEES:
                    //trace("SERVER_COMMAND_USER_SMALLFEES");
                    S_SmallFees();
                    return;
                case SERVER_COMMAND_VENUECOSTS:
                    //trace("SERVER_COMMAND_VENUECOSTS");
                    S_Venuecosts();
                    return;
                case SERVER_COMMAND_SNGLOGIN_SUCCESS:
                    //trace("SERVER_COMMAND_SNGLOGIN_SUCCESS");
                    S_SngLoginSuccess();
                    return;
                case SERVER_COMMAND_SNGBIND_SUCCESS:
                    //trace("SERVER_COMMAND_SNGBIND_SUCCESS");
                    S_SngBindSuccess();
                    return;
                case SERVER_BROADCAST_SNGGAME_START:
                    //trace("SERVER_BROADCAST_SNGGAME_START");
                    S_SngGameStart();
                    return;
                case SERVER_COMMAND_SNGUSERSTANDINFO:
                    //trace("SERVER_COMMAND_SNGUSERSTANDINFO");
                    S_SngUserStandInfo();
                    return;
                case SERVER_COMMAND_SNGTALBESTATE:
                    //trace("SERVER_COMMAND_SNGTALBESTATE");
                    S_SngTalbeState();
                    return;
                case SERVER_COMMAND_SNGUSERRANKINFO:
                    //trace("SERVER_COMMAND_SNGUSERRANKINFO");
                    S_SngUserRankInfo();
                    return;
                case SERVER_COMMAND_SNGALLLOGIN_SUCCESS:
                    //trace("SERVER_COMMAND_SNGALLLOGIN_SUCCESS");
                    S_SngallLoginSuccess();
                    return;
                case SERVER_COMMAND_SNGALLBIND_SUCCESS:
                    //trace("SERVER_COMMAND_SNGALLBIND_SUCCESS");
                    S_SngallBindSuccess();
                    return;
                case SERVER_COMMAND_USERLOGIN:
                    //trace("SERVER_COMMAND_USERLOGIN");
                    S_UserLogin();
                    return;
                case SERVER_COMMAND_USERLOGOUT:
                    //trace("SERVER_COMMAND_USERLOGOUT");
                    S_UserLogOut();
                    return;
                case SERVER_CMD_CONNECT_GAMESERVER_SUCCESS:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_SUCCESS");
                    P_ConnectGameServerSuccess();
                    return;
                case SERVER_CMD_CONNECT_GAMESERVER_FAILED:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_FAILED");
                    P_ConnectGameServerFailed();
                    return;
                case SERVER_COMMAND_SNGTIMESMALLBLIN:
                    //trace("SERVER_COMMAND_SNGTIMESMALLBLIN");
                    S_SngTimeSmallblin();
                    return;
                case SERVER_COMMAND_LOTTERYBUY:
                    //trace("SERVER_COMMAND_LOTTERYBUY");
                    S_LotteryBuy();
                    return;
                case SERVER_COMMAND_LOTTERYMONEY:
                    //trace("SERVER_COMMAND_LOTTERYMONEY");
                    S_LotteryMoney();
                    return;
                case SERVER_COMMAND_SYSKICKUSER:
                    //trace("SERVER_COMMAND_SYSKICKUSER");
                    S_SysKickUser();
                    return;
                case SERVER_COMMAND_USERUPDATAEXP:
                    //trace("SERVER_COMMAND_USERUPDATAEXP");
                    S_UserUpdataExp();
                    return;
                case SERVER_COMMAND_SHOWDEALPREFLOPCARD:
                    //trace("SERVER_COMMAND_SHOWDEALPREFLOPCARD");
                    S_ShowDealPreflopCard();
                    return;
                case SERVER_COMMAND_MTTSNGRANKDATA:
                    //trace("SERVER_COMMAND_MTTSNGRANKDATA");
                    S_MttSngRankData();
                    return;
                case SERVER_COMMAND_MTTSNGUSERRANKINFO:
                    //trace("SERVER_COMMAND_MTTSNGUSERRANKINFO");
                    S_MttSngUserRankInfo();
                    return;
                case SERVER_COMMAND_MTTSNGUSEROVERINFO:
                    //trace("SERVER_COMMAND_MTTSNGUSEROVERINFO");
                    S_MttSngUserOverInfo();
                    return;
                case SERVER_COMMAND_MTTSNGCHANGETABLE:
                    //trace("SERVER_COMMAND_MTTSNGCHANGETABLE");
                    S_MttSngChangeTable();
                    return;
                case SERVER_COMMAND_MTTSNGTIMESTART:
                    //trace("SERVER_COMMAND_MTTSNGTIMESTART");
                    S_MttSNGtimeStart();
                    return;
                case SERVER_CMD_CONNECT_GAMESERVER_SUCCESS_S:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_SUCCESS");
                    P_ConnectGameServerSuccess();
                    return;
                case SERVER_CMD_CONNECT_GAMESERVER_FAILED_S:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_FAILED");
                    P_ConnectGameServerFailed();
                    return;
                case SERVER_COMMAND_CHANGESERVER:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_FAILED");
                    S_ChangeServer();
                    return;
                case SERVER_COMMAND_GLODRUSHCHANGEROOM:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_FAILED");
                    S_GlodRushChangeRoom();
                    return;
                case SERVER_COMMAND_MTTFINAL:
                    //trace("SERVER_CMD_CONNECT_GAMESERVER_FAILED");
                    S_GlodRushFinel();
                    return;
                case SERVER_COMMAND_STANDTIMING:
                    //trace("站起倒计时");
                    S_Standtiming();
                    return;
                case SERVER_COMMAND_USER_CHANGE_SERVER:
                    S_GoldrushChangeSever();
                    return;
                case SERVER_COMMAND_RANK_ONE_NOTICE:
                    S_ProcessSngOneRank();
                    return;
                default:
                    //trace("PacketErr");
                    return;
            };
        }

        private void S_ProcessSngOneRank()
        {
            //var _local1:int;
            //var _local2:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_local2 = _mySokcet.readInt();
            //_gameProceess.ProcessSngOneRank(_local2, _local1);
            throw new NotImplementedException();
        }

        private void S_MttSNGtimeStart()
        {
            //var _local1:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_gameProceess.ProcessMttSNGtimeStart(_local1);
            throw new NotImplementedException();
        }

        private void S_UserAction()
        {
            //var _local1:int;
            //var _local2:int;
            //var _local3:int;
            //var _local4:Number;
            //var _local5:Number;
            //var _local6:Number;
            //var _local7:Number;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.getsubver();
            //_local2 = _mySokcet.readByte();
            //_local3 = _mySokcet.readByte();
            //_local4 = 0;
            //if (_local1 == SERVER_SUBPACKET_VER2)
            //{
            //    _local4 = _mySokcet.readInt64();
            //}
            //else
            //{
            //    _local4 = _mySokcet.readInt();
            //};
            //_local5 = _mySokcet.readInt64();
            //_local6 = _mySokcet.readInt64();
            //_local7 = _mySokcet.readInt64();
            //_gameProceess.ProcessUserAction(_local2, _local3, _local4, _local5, _local6, _local7);
            throw new NotImplementedException();
        }

        private void S_Tableinfo()
        {
            //var _local1:Number;
            //var _local2:int;
            //var _local3:int;
            //var _local4:int;
            //var _local5:int;
            //var _local6:int;
            //var _local7:int;
            //var _local8:Array;
            //var _local9:int;
            //var _local10:Array;
            //var _local11:int;
            //var _local12:Number;
            //var _local13:Number;
            //var _local14:Number;
            //var _local15:int;
            //var _local16:int;
            //var _local17:int;
            //var _local18:Number;
            //var _local19:String;
            //var _local20:String;
            //var _local21:String;
            //var _local22:String;
            //var _local23:String;
            //var _local24:Number;
            //var _local25:int;
            //var _local26:int;
            //_mySokcet.readbegin();
            //_local2 = _mySokcet.readByte(); // 处于Flop Turn River的哪个阶段，3， 4，5代表
            //_local3 = _mySokcet.readByte(); // GameRoomData.instance.maxCount
            //_local4 = _mySokcet.readInt();  // 
            //_local5 = _mySokcet.readByte(); // dealer index GameRoomData.instance.dealer
            //_local6 = _mySokcet.readByte(); // total usr count
            //_local7 = _mySokcet.readByte(); //  _potsList size ? _potsList代表什么意思
            //_local8 = new Array(); // _potsList
            //_local9 = 0;
            //while (_local9 <= _local7)
            //{
            //    _local1 = _mySokcet.readInt64();
            //    _local8.push(_local1);
            //    _local9++;
            //};
            //_local10 = new Array();
            //if ((((_local2 >= 3)) && ((_local2 <= 5))))
            //{
            //    _local15 = 0;
            //    while (_local15 < _local2)
            //    {
            //        _local10[_local15] = _mySokcet.readShort();  // 读取public card list 桌面明牌列表
            //        _local15++;
            //    };
            //};
            //_local11 = _mySokcet.readShort();  ProcessStartChipin  arg1 UsrSeatID
            //_local12 = 0;
            //_local13 = 0;
            //_local14 = 0;
            //if (_local11 != 0)   
            //{
            //    _local12 = _mySokcet.readInt64(); ProcessStartChipin arg2 -> RoomOperation.showChipin arg1 -> ChipInManager.showChipInPanel arg1 _needCall
            //    _local13 = _mySokcet.readInt64(); ProcessStartChipin arg3 -> RoomOperation.showChipin arg2 -> ChipInManager.showChipInPanel arg2 _needRaise
            //    _local14 = _mySokcet.readInt64(); ProcessStartChipin arg4 -> RoomOperation.showChipin arg3 -> ChipInManager.showChipInPanel arg3 _maxRaise
            //};
            //_local9 = 0;
            //while (_local9 < _local6)
            //{
            //    _local16 = _mySokcet.readByte();   // usr seat ID
            //    _local17 = _mySokcet.readInt();    // SeatData.userData.mid 
            //    _local18 = _mySokcet.readInt64();  // SeatData.userDatauserData.coin
            //    _local19 = _mySokcet.readString(); // SeatData.userData.userName
            //    _local20 = _mySokcet.readString(); // SeatData.userData.imgUrl
            //    _local21 = _mySokcet.readString(); // SeatData.userData.level
            //    _local22 = _mySokcet.readString(); // SeatDatauserData.userOther
            //    _local23 = _mySokcet.readString(); // SeatDatauserData.gift
            //    _local1 = _mySokcet.readInt64();   // SeatData.seatMoney,SeatData.bureauMoney
            //    _local24 = _mySokcet.readInt64();  // SeatData.seatChips
            //    _local25 = _mySokcet.readByte();   // SeatData.userData.isPlay
            //    _local26 = _mySokcet.readByte();   // SeatData.chipinType
            //    _gameProceess.ProcessUserSit(_local16, _local17, _local1, _local24, _local19, _local20, _local21, _local22, _local23, _local25, _local18, _local26);
            //    _local9++;
            //};
            //if ((((_local6 >= 2)) && ((_local5 >= 0))))
            //{
            //    _gameProceess.ProcessTableinfo(_local2, _local11, _local12, _local13, _local14, _local5, _local10, _local8, _local3, _local4);
            //}
            //else
            //{
            //    _gameProceess.ProcessEmptyTableinfo(_local6, _local3, _local4);
            //};
            throw new NotImplementedException();
        }

        private void S_StopServer()
        {
            //var type:int;
            //var str:String;
            //_mySokcet.readbegin();
            //type = _mySokcet.readInt();
            //try
            //{
            //    str = _mySokcet.readString();
            //}
            //catch(e:Error)
            //{
            //};
            //_gameProceess.ProcessStopServer(type, str);
            throw new NotImplementedException();
        }

        private void S_MttSngChangeTable()
        {
            //var _local1:int;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readInt();
            //_gameProceess.ProceesMttSngChangeTable();
            throw new NotImplementedException();
        }

        private void S_DealRiver()
        {
            //var _local1:uint;
            //_mySokcet.readbegin();
            //_local1 = _mySokcet.readShort();
            //_gameProceess.ProcessDealRiver(_local1);
            throw new NotImplementedException();
        }

        private void S_BindSuccess()
        {
            int _local1;
            int _local2;
            Int64 _local3;
            Int64 _local4;
            string _local5;
            Int64 _local6;
            int _local7;
            short _local8;
            short _local9;
            int _local10;
            _mySokcet.readbegin();
            _local1 = _mySokcet.getsubver();
            _local2 = _mySokcet.readInt();
            if (_local1 == SERVER_SUBPACKET_VER2)
            {
                _local3 = _mySokcet.readInt64();
                _local4 = _mySokcet.readInt64();
            }
            else
            {
                _local3 = _mySokcet.readInt();
                _local4 = _mySokcet.readInt();
            };
            _local5 = _mySokcet.readString();
            _local6 = _mySokcet.readInt64();
            _local7 = _mySokcet.readShort();
            _local8 = 0;
            _local9 = 0;
            if (_local7 != 0)
            {
                _local8 = _mySokcet.readShort();
                _local9 = _mySokcet.readShort();
            };
            _local10 = _mySokcet.readInt();
            //_gameProceess.ProcessBindSuccess(_local5, _local2, _local3, _local4, _local6, _local7, _local8, _local9, _local10);
            //throw new NotImplementedException();
        }

        private void S_FinalGame()
        {
            //var PotSID:int;
            //var PotSmoney:Number;
            //var nPlaying:int;
            //var size:int;
            //var i:int;
            //var id:int;
            //var money:Number;
            //var Card1:uint;
            //var Card2:uint;
            //var Type:uint;
            //var goodCard1:uint;
            //var goodCard2:uint;
            //var goodCard3:uint;
            //var goodCard4:uint;
            //var goodCard5:uint;
            //_mySokcet.readbegin();
            //PotSID = _mySokcet.readByte();
            //PotSmoney = _mySokcet.readInt64();
            //nPlaying = _mySokcet.readByte();
            //size = _mySokcet.readByte();
            //i = 0;
            //while (i < size)
            //{
            //    id = _mySokcet.readByte();
            //    money = _mySokcet.readInt64();
            //    Card1 = _mySokcet.readShort();
            //    Card2 = _mySokcet.readShort();
            //    Type = _mySokcet.readByte();
            //    goodCard1 = _mySokcet.readShort();
            //    goodCard2 = _mySokcet.readShort();
            //    goodCard3 = _mySokcet.readShort();
            //    goodCard4 = _mySokcet.readShort();
            //    goodCard5 = _mySokcet.readShort();
            //    try
            //    {
            //        if (nPlaying < 2)
            //        {
            //            Type = 0;
            //        };
            //        _gameProceess.ProcessMarkPots(PotSID, PotSmoney, nPlaying, id, money, Card1, Card2, Type, goodCard1, goodCard2, goodCard3, goodCard4, goodCard5);
            //    }
            //    catch(err)
            //    {
            //    };
            //    i = (i + 1);
            //};
            //_gameProceess.ProcessPotsMove(nPlaying);
            throw new NotImplementedException();
        }

        private void S_UserChipInErr()
        {
            //_mySokcet.readbegin();
            //_gameProceess.ProceesChipinErr();
            throw new NotImplementedException();
        }

        //private void judgeBlind(_arg1:int, _arg2:Array):Array
        //{
        //    var _local3:Array;
        //    var _local4:Array;
        //    var _local5:int;
        //    var _local6:int;
        //    _local3 = [];
        //    _local4 = [];
        //    _local5 = _arg2.length;
        //    _local6 = 0;
        //    while (_local6 < _arg2.length)
        //    {
        //        if (_local5 == 2)
        //        {
        //            if (_arg2[_local6] >= _arg1)
        //            {
        //                _local3[_local3.length] = _arg2[_local6];
        //            }
        //            else
        //            {
        //                _local4[_local4.length] = _arg2[_local6];
        //            };
        //        }
        //        else
        //        {
        //            if (_arg2[_local6] > _arg1)
        //            {
        //                _local3[_local3.length] = _arg2[_local6];
        //            }
        //            else
        //            {
        //                _local4[_local4.length] = _arg2[_local6];
        //            };
        //        };
        //        _local6++;
        //    };
        //    _local3.sort();
        //    _local4.sort();
        //    return (_local3.concat(_local4));
        //}


    }
}
